;; 当前行高亮
(global-hl-line-mode t)
;; 关闭工具滚条页面
(tool-bar-mode -1)
(scroll-bar-mode -1)
;; 关闭启动页
(setq inhibit-startup-screen t)

;; 高亮代码所在括号
(define-advice show-paren-function (:around (fn) fix-show-paren-function)
  "Highlight enclosing parens."
  (cond ((looking-at-p "\\s(") (funcall fn))
	(t (save-excursion
	     (ignore-errors (backward-up-list))
	     (funcall fn)))))
;; 主题
(use-package gruvbox-theme
	     :init (load-theme 'gruvbox-dark-soft t))
;; 状态栏主题
(use-package smart-mode-line
	     :init
	     (setq sml/no-confirm-load-theme t
		   sml/theme 'respectful)
	     (sml/setup))

;; 简写确认提示
(defalias 'yes-or-no-p 'y-or-n-p)

;; 行号
;;(use-package emacs
;;  :config
;;  (setq display-line-numbers-type 'relative)
;;  (global-display-line-numbers-mode t))
;(global-linum-mode 1)

;; 配置字体,优化windows速度
(use-package emacs
  :if (display-graphic-p)
  :config
  (if *is-windows*
      (progn
	(set-face-attribute 'default nil
			    :font "Microsoft Yahei UI 12")
	(dolist (charset '(kana han symbol cjk-misc bopomofo))
	  (set-fontset-font (frame-parameter nil 'font)
			    charset (font-spec
				     :family "Micosoft Yahei UI"
				     :size 12))))
    (set-face-attribute 'default nil
			:font "Source Code Pro for Powerline 11")))

(provide 'init-ui)
